package net.lahuobao.finance.controller.registerManagement;

import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.log4j.Logger;
import org.jeecgframework.core.common.controller.BaseController;
import org.jeecgframework.core.common.model.json.AjaxJson;
import org.jeecgframework.core.common.model.json.DataGrid;
import org.jeecgframework.tag.core.easyui.TagUtil;
import org.jeecgframework.web.system.service.SystemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import net.lahuobao.finance.dao.OrganizationMapper;
import net.lahuobao.finance.dao.UserMapper;
import net.lahuobao.finance.entity.depart.EValidateState;
import net.lahuobao.finance.entity.organizationEntity.OrganizationEntity;
import net.lahuobao.finance.service.organizationManagement.IOrganizationService;



/**   
 * @Title: Controller
 * @Description: 资金明细账
 * @author zhangdaihao
 * @date 2016-08-24 18:49:17
 * @version V1.0   
 *
 */
@Controller
@RequestMapping("/czAndDriverManagerController")
public class CzAndDriverManagerController extends BaseController {
	/**
	 * Logger for this class
	 */
	private static final Logger logger = Logger.getLogger(CzAndDriverManagerController.class);

	@Autowired
	private SystemService systemService;
	@Autowired
	private UserMapper userDao;




	/**
	 * 资金明细 页面跳转
	 * 
	 * @return
	 */
	@RequestMapping(params = "list")
	public ModelAndView list(HttpServletRequest request) {
		ModelAndView mv = new ModelAndView("/net/lahuobao/finance/registerManagement/recommemdUserList");
		mv.addObject("organizationId", request.getParameter("organizationId"));
		return mv;
	}


	/**
	 * easyui AJAX请求数据
	 * 
	 * @param request
	 * @param response
	 * @param dataGrid
	 * @param user
	 */

	@RequestMapping(params = "datagrid")
	public void datagrid(HttpServletRequest request, HttpServletResponse response, DataGrid dataGrid) {
		Map paramMap = new HashMap();//sql 参数
	
		paramMap.put("czUserName",request.getParameter("czUserName"));

		paramMap.put("czVehicleNo",request.getParameter("czVehicleNo"));
		
		paramMap.put("sjFullname",request.getParameter("sjFullname"));
		
		paramMap.put("organizationId",request.getParameter("organizationId"));
		

		List<Map> list= userDao.selectCzAndDriverByInfo(paramMap, systemService.getPageBounds());
	
        TagUtil.datagrid(response,  pageDateGrid(list, dataGrid));

	}

}
